<?php

namespace App\Http\Controllers\Admin\Syj;

use App\Common\Responses;
use App\Http\Controllers\Controller;
use App\Models\Syj\lives;
use Illuminate\Http\Request;

class liveList extends Controller
{
    //房东直播间展示
    public function findLive(){
        $data = lives::listLives();
        return Responses::success($data,20000,'success');
    }
    //房东直播间删除
    public function delLive(Request $request){
        $ids = $request->ids;
        $lives = lives::removeLive($ids);
        return Responses::success($lives,20000,'success');
    }

    //房东直播间新增
    public function addLive(Request $request){
        $data = $request->validate([
            'title' =>'required|max:255',
            'url' =>'required|max:255',
        ]);
        $lives = lives::addLive($data);
        return Responses::success($lives,20000,'success');
    }
}
